

const user = {
  state: {
    user: {},
    menuList: [],
    // 第一次加载菜单时用到
    loadMenus: false,
    instId:null,//机构分组号
    instSub:null,//机构分公司分组号
    treeList:[],
    orgList:[],
    groupIds:'null'
  },

  mutations: {
    SET_USER: (state, user) => {
      state.user = user
    },
    SET_ROLES: (state, roles) => {
      state.roles = roles
    },
    SET_MENU_LIST: (state, list) => {
      console.log(list)
      state.menuList = list
    },
    SET_GROUPID:(state,id)=>{
      console.log('进入没0000000000000===>',id)
      state.groupIds = id
    },
    //选择机构
    SELECT_ORG: (state, list) => {
      console.log(list)
      state.instId = list[0]
      state.instSub = list[1]
      state.orgList = list
    },
    // 选中的树形结构
    SELECT_TREE: (state, list) => {
      if(list instanceof Array) {
        state.treeList=list
      } else {
        state.treeList.push(list)
      }
      

    }
  }
}

export default user